import request from '../../utils/request';
import { OnionUtils } from '../../utils/onion-utils';

//查询角色列表
export const doFindRole = queryData => {
    return request({
        url: '/api/authic/role/findPage',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'queryData'},
        buildType : 'queryData',
        data: queryData
    });
};

//获取角色菜单资源列表
export const doFindRoleMenuResource = queryData =>{
    return request({
        url: '/api/authic/role/findRoleMenuResource',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'queryData'},
        data: queryData
    });
};

//获取角色权限树
export const doFindRoleAuthTree = queryData =>{
    return request({
        url: '/api/authic/role/findRoleAuthTree',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'queryData'},
        data: queryData
    });
};

//保存角色信息
export const doSaveRole = formData => {
    return request({
        url: '/api/authic/role/save',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: formData
    });
};

//获取角色信息
export const doGetRole = paramData => {
    return request({
        url: '/api/authic/role/get',
        method: 'post',
        header:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: paramData
    });
};

//删除角色信息
export const doDeleteRole = paramData => {
    return request({
        url: '/api/authic/role/delete',
        method: 'post',
        headers:{'Content-Type':'application/json', 'Build-Type':'formData'},
        data: paramData
    });
};